home *** CD-ROM | disk | FTP | other *** search
- Path: news.magicnet.net!usenet
- From: gamecox@magicnet.net (Jody Hagins)
- Newsgroups: comp.lang.c++
- Subject: Re: Pure Virtual Destructor Question
- Date: 11 Feb 1996 01:39:27 GMT
- Organization: MagicNet, Inc.
- Message-ID: <4fjhcf$8v0@comet2.magicnet.net>
- References: <4fecq0$k4e@news4.digex.net> <4fg2s5$r02@cnn.exu.ericsson.se>
- NNTP-Posting-Host: pm1-04.magicnet.net
- X-Newsreader: WinVN 0.92.6+
-
- In article <4fg2s5$r02@cnn.exu.ericsson.se>, ebumow@ebu.ericsson.com (Mickey Williams 66753) says:
- >
- >In article k4e@news4.digex.net, ell@access4.digex.net (Ell) writes:
- >
- >>Immediately above you are logically "defining" your "pure virtual"
- >>destructor "inside the class where it is "declared" as a pure virtual
- >>function. It is _illegal_ to logically, or physically "define" a pure
- >>virtual function in the class it is "declared" in. A pure virtual should
- >>only be defined in classes derived from the class where the pure virtual
- >>is declared. Only derived classes should "do some destructor stuff".
- >
- >This is not true in the case of pure virtual destructors. You must
- >always provide a function body for a virtual dtor, even if it
- >is pure.
-
- It's not even true for other virtual functions. However, you stated
- what I want, sort of. I want to do the following, but as an
- "in-the-class-declaration-inline-function"
-
- class Foo
- {
- public:
- virtual ~Foo() = 0;
- };
-
- Foo::~Foo()
- {
- // do something
- }
-
- -Jody
-